package site.zhouinfo.aop;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * @author zhou
 * @create 2017-08-29 17:17
 * @email zhouinfo@qq.com
 * @blog blog.zhouinfo.site
 */
public class MyLogger implements InvocationHandler {

    public Object tagert;

    public MyLogger(Object tagert) {
        this.tagert = tagert;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println("打印日志前");
        Object invoke = method.invoke(tagert, args);
        System.out.println("打印日志后");
        return invoke;
    }
}
